Log probabilities are summes instead of multiplied. The \texttt{logsum}
and\texttt{logsum\_by\_row} calculate what would be the sum if we were to use
normal probabilities.
The pseudocode consists of parts of the original codes with most
language-specific operations removed.

\begin{verbatim}
Function E-step (log probabilities)
for i = 1:K
	 Q(:, i) = log(pi) + logN(X, mu, sigma);
end
vec = logsums_by_row(Q);
% normalise
Q -= vec
% make normal probabilities
Q = exp(Q);
LL = logsums(vec);
\end{verbatim}

The code can be found at \texttt{code.google.com/p/mlpr-mc/}.
